PROG = dictc
CC := icc
CFLAGS	:= -O2 -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
CFLAGS	+= -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual
CFLAGS	+= -Wsign-compare -fPIC -I. -fPIE -axSSE4.2 -march=core-avx-i 
LDFLAGS	:= -ledit -lutil
OBJS	:= $(patsubst %.c,%.o,$(wildcard *.c))

all : $(PROG)

$(PROG) : $(OBJS)
	@echo "building $@"
	@${CC} -fPIC -o $@ $^ ${LDFLAGS}

%.o: %.c
	@echo "compiling $<"
	@${CC} ${CFLAGS} -c -o $@ $<

clean:
	@echo "cleaning... ${PROG} ${OBJS}"
	@${RM} ${PROG} ${OBJS}
